package com.xxxx.crm.controller;

import com.xxxx.crm.base.BaseController;
import com.xxxx.crm.base.ResultInfo;
import com.xxxx.crm.model.TreeModel;
import com.xxxx.crm.service.ModuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author:王亚栋
 * @Date: 2023/4/22 下午7:46
 * @Version:1.0
 */
@Controller
@RequestMapping("module")
public class ModuleController extends BaseController {

    @Autowired
    private ModuleService moduleService;

    @GetMapping("/queryAllModules")
    @ResponseBody
    public List<TreeModel> queryAllModules(Integer userId){

        return moduleService.queryAllModules(userId);
    }

    @GetMapping("/toAddGrantPage")
    public String toAddGrantPage(Integer roleId){

        return "role/grant";
    }
}
